Skip to content

chore(fast-html): use @microsoft/fast-build to build deep-merge fixture#7390

Merged
janechu merged 1 commit intomainfrom
users/janechu/update-fixture-to-use-fast-build-deep-merge
Apr 10, 2026
Merged

chore(fast-html): use @microsoft/fast-build to build deep-merge fixture#7390
janechu merged 1 commit intomainfrom
users/janechu/update-fixture-to-use-fast-build-deep-merge

Conversation

@janechu
Copy link
Copy Markdown
Collaborator

@janechu janechu commented Apr 4, 2026

Pull Request

📖 Description

Adds the deep-merge test fixture to @microsoft/fast-html and registers it in the build-fixtures.js script so it is built using @microsoft/fast-build.

This continues the incremental migration of test fixtures to the fast-build CLI by adding the fixture source files (entry.html, templates.html, state.json) and including "deep-merge" in the fixtures array.

📑 Test Plan

  • All existing tests pass.
  • The deep-merge fixture builds successfully via npm run build -w @microsoft/fast-html.

✅ Checklist

General

  • I have included a change request file using $ npm run change
  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

janechu added a commit that referenced this pull request Apr 8, 2026
…ssions (#7394)

# Pull Request

## 📖 Description

Fixes two gaps in the `microsoft-fast-build` Rust renderer related to data access in template expressions:

1. **Array `.length` support** — `{{items.length}}` now resolves correctly. Previously, `get_nested_property` tried to parse `"length"` as a numeric array index, which always failed and returned a `MissingState` error. A special case now returns the array's length as a number.

2. **JSON literal attribute values** — Custom element attributes can now accept JSON array and object literals directly (e.g. `items='["a","b","c"]'` or `config='{"title":"Hello"}'`). Previously, these were passed through as raw strings, causing child templates that iterated or accessed nested values to fail.

### 🎫 Issues

* Helps unblock [#7390](#7390) — deep-merge fixture uses `{{users.length}}` and `{{user.orders.length}}`
* Helps unblock [#7388](#7388) — observer-map fixture uses `{{user.posts.length}}`

## 📑 Test Plan

New Rust integration tests added:

- `tests/bindings.rs` — `test_array_length`, `test_array_length_empty`, `test_array_length_nested`
- `tests/f_when.rs` — `test_when_array_length_gt_zero`, `test_when_array_length_zero`
- `tests/custom_elements.rs` — `test_custom_element_json_array_attr`, `test_custom_element_empty_array_attr`, `test_custom_element_json_object_attr`

All existing and new tests pass (`cargo test`).

## ✅ Checklist

### General

- [x] I have included a change request file using `$ npm run change`
- [x] I have added tests for my changes.
- [x] I have tested my changes.
- [x] I have updated the project documentation to reflect my changes.
- [x] I have read the [CONTRIBUTING](https://github.com/microsoft/fast/blob/main/CONTRIBUTING.md) documentation and followed the [standards](https://github.com/microsoft/fast/blob/main/CODE_OF_CONDUCT.md#our-standards) for this project.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@janechu janechu force-pushed the users/janechu/update-fixture-to-use-fast-build-deep-merge branch from 91629e0 to 90c22fd Compare April 10, 2026 04:40
@janechu janechu marked this pull request as ready for review April 10, 2026 04:50
@janechu janechu merged commit ebd20dc into main Apr 10, 2026
11 of 14 checks passed
@janechu janechu deleted the users/janechu/update-fixture-to-use-fast-build-deep-merge branch April 10, 2026 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant